package com.jinghua.treatment.controller;

import com.jinghua.treatment.service.EmployeeMessageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by LV
 */


@Controller
@RequestMapping("/prescription")
public class EmployeeMessageController {

    @Resource
    private EmployeeMessageService employeeMessageService;

    @ApiOperation(value="查询医生列表")
    @GetMapping(value="/queryDoctorList")
    @ResponseBody
    public String countAllPrescriptions(String userId, Model model){
        model.addAttribute("doctorList",employeeMessageService.queryDoctorList(userId));
        return "doctorMessage";
    }

    @ApiOperation(value="查询业务员信息")
    @GetMapping(value="/queryEmployeeMessage")
    @ResponseBody
    public String queryEmployeeMessage(String userId, Model model){
        model.addAttribute("doctorList",employeeMessageService.queryEmployeeMessage(userId));
        return "doctorMessage";
    }
}
